package com.wf.course.service.impl;

import com.utils.page.PageBean;
import com.wf.course.dao.ICourseGiftMapper;
import com.wf.course.model.course.CourseGift;
import com.wf.course.service.ICourseGiftService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

/**
 * @Auther: liu
 * @Date: 2018/6/12 10:43
 * @Description:
 */
@Service
@Transactional(rollbackFor = Exception.class)
public class ICourseGiftServiceImpl implements ICourseGiftService {

    @Autowired
    private ICourseGiftMapper courseGiftMapper;

    @Override
    public void list(PageBean<CourseGift> pageBean) {
        pageBean.setResults(courseGiftMapper.list(pageBean));
        pageBean.setTotalCount(courseGiftMapper.count(pageBean));
    }

    @Override
    public Integer add(CourseGift courseGift) {
        return courseGiftMapper.add(courseGift);
    }

    @Override
    public Integer delete(CourseGift courseGift) {
        return courseGiftMapper.delete(courseGift);
    }

    @Override
    public Integer update(CourseGift courseGift) {
        return courseGiftMapper.update(courseGift);
    }

    @Override
    public CourseGift getGiftInfoById(Integer id) {
        return courseGiftMapper.getGiftInfoById(id);
    }
}
